/*package tests.questions;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import kpi.java_training.testing.questions.ManyFromManyQuestion;

import java.lang.reflect.Field;
import java.util.ArrayList;

/**
 * Test

public class ManyFromManyQuestionTest {

    private ManyFromManyQuestion question;
    private Field f;
    private ArrayList<Integer> answers;

    @Before
    public void setUp() {
        ArrayList<String> qVariants = new ArrayList<String>();
        qVariants.add("first");
        qVariants.add("second");
        qVariants.add("third");
        ArrayList<Integer> cAnswers = new ArrayList<Integer>();
        cAnswers.add(2);
        cAnswers.add(4);
        question = new ManyFromManyQuestion("test question", qVariants, cAnswers);
    }

    public void setAnswersValue() throws Exception {
        f = ManyFromManyQuestion.class.getDeclaredField("answers");
        f.setAccessible(true);
        answers = (ArrayList<Integer>) f.get(question);
    }

    public ArrayList<Integer> getStandardAnswers(int ... params) {
        ArrayList<Integer> answers = new ArrayList<Integer>();
        for (int i=0; i < params.length; i++) {
            answers.add(params[i]);
        }
        return answers;
    }

    @Test
    public void testSetAnswerString2_4() throws Exception {
        question.setAnswer("2 4");
        setAnswersValue();
        Assert.assertTrue(getStandardAnswers(new int[]{2, 4}).containsAll(answers));
    }

    @Test
    public void testSetAnswerString1() throws Exception {
        question.setAnswer("1");
        setAnswersValue();
        Assert.assertTrue(getStandardAnswers(new int[]{1}).containsAll(answers));
    }

    @Test
    public void testSetAnswerString3_5_10_20_2() throws Exception {
        question.setAnswer("3 5 10 20 2");
        setAnswersValue();
        Assert.assertTrue(getStandardAnswers(new int[]{2, 3, 5, 10, 20}).containsAll(answers));
    }


    @Test
    public void testIsCorrect1_2() {
        question.setAnswer("1 2");
        Assert.assertFalse(question.isCorrect());
    }

    @Test
    public void testIsCorrect2() {
        question.setAnswer("2");
        Assert.assertFalse(question.isCorrect());
    }

    @Test
    public void testIsCorrect4() {
        question.setAnswer("4");
        Assert.assertFalse(question.isCorrect());
    }

    @Test
    public void testIsCorrectEmpty() {
        question.setAnswer("");
        Assert.assertFalse(question.isCorrect());
    }

    @Test
    public void testIsCorrect2_4_5() {
        question.setAnswer("2 4 5");
        Assert.assertFalse(question.isCorrect());
    }

    @Test
    public void testIsCorrect2_4() {
        question.setAnswer("2 4");
        Assert.assertTrue(question.isCorrect());
    }

    @Test
    public void testIsCorrect4_2() {
        question.setAnswer("4 2");
        Assert.assertTrue(question.isCorrect());
    }

    @Test
    public void testIsCorrect2_2() {
        question.setAnswer("2 2");
        Assert.assertFalse(question.isCorrect());
    }
}
*/